package com.java.simple.smallspring.beans.factory.config;

import com.java.simple.smallspring.beans.factory.HierarchicalBeanFactory;
import com.java.simple.smallspring.core.convert.ConversionService;
import com.java.simple.smallspring.util.StringValueResolver;
import com.sun.istack.internal.Nullable;

/**
 * @author zhoujunlin
 * @date 2022年08月20日 21:28
 * @desc
 */
public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, SingletonBeanRegistry {

    String SCOPE_SINGLETON = "singleton";
    String SCOPE_PROTOTYPE = "prototype";

    void addBeanPostProcessor(BeanPostProcessor beanPostProcessor);

    /**
     * 销毁单例对象
     */
    void destroySingletons();

    /**
     * Add a String resolver for embedded values such as annotation attributes
     *
     * @param valueResolver
     */
    void addEmbeddedValueResolver(StringValueResolver valueResolver);

    /**
     * resolve the given embedded value
     *
     * @param value
     * @return
     */
    String resolveEmbeddedValue(String value);

    void setConversionService(ConversionService conversionService);

    @Nullable
    ConversionService getConversionService();

}
